package com.zto.thymeleaf.common;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
@Configuration
public class MyWebAppConfigurer
        extends WebMvcConfigurerAdapter {
 
    
    /**
     * 自定义资源映射   http://localhost:9999/thymeleaf/myres/test1.jpg
     * <p>Title: addResourceHandlers</p>   
     * <p>Description: </p>   
     * @param registry   
     * @see org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter#addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry)
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/myres/**").addResourceLocations("classpath:/myres/");
        super.addResourceHandlers(registry);
    }
 
}